import actionsType from "./actionsType";
const initState = {
  cityList: [],
  city: {}
}

const reducer = (state = initState, action) => {
  const {
    type,
    payload
  } = action
  switch (type) {
    case actionsType.SET_CITY:
      console.log('当前城市', payload);
      return {
        ...state,
        city: payload
      };
    case actionsType.SET_CITY_LIST:
      console.log('当前城市列表', payload);
      return {
        ...state,
        cityList: payload
      };
    default:
      return {
        ...state
      }
  }
}

export default reducer